package com.fs.controller.vo.price;
import com.fs.service.bo.price.BoPriceWithRoom;
import lombok.Data;
import lombok.experimental.Accessors;

import java.time.LocalTime;
import java.time.format.DateTimeFormatter;

/**
 * @author : ppx
 * @date : 10:29 2021/3/8
 */
@Data
@Accessors(chain = true)
public class RespRoomPrice {

    private Integer id;
    private Integer roomId;
    private Float price;
    private String beginDateTime;
    private String endDateTime;

    public RespRoomPrice(BoPriceWithRoom priceWithRoom) {
        this.id=priceWithRoom.getId();
        this.roomId = priceWithRoom.getRoom().getId();
        this.price = priceWithRoom.getPrice();
        this.beginDateTime = priceWithRoom.getBeginTime().format(DateTimeFormatter.ofPattern("HH:mm"));
        this.endDateTime = priceWithRoom.getEndTime().format(DateTimeFormatter.ofPattern("HH:mm"));
    }


}
